package com.zfzs.post.modules.post.repository;

import com.zfzs.post.modules.agent.domain.Agent;
import com.zfzs.post.modules.post.domain.TerminalType;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
* @author ck
* @date 2019-09-27
*/
public interface TerminalTypeRepository extends JpaRepository<TerminalType, Long>, JpaSpecificationExecutor {
    //根据channelId查询
    List<TerminalType> findByChannelId(Long channelId);

    //根据姓名或者手机号码模糊查询
    @Query(value = "select p.url from picture p where p.id =  ?1", nativeQuery = true)
    String findUrlByImgId(Long id);
}